home *** CD-ROM | disk | FTP | other *** search
/ Aminet 19 / Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso / Aminet / dev / c / vbcc.lha / vbcc / vars.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-03-02  |  3.6 KB  |  113 lines

  1. /*  $VER: vbcc (vars.c) V0.4    */
  2.  
  3. #include "vbc.h"
  4.  
  5. char *typname[]={"strange","char","short","int","long","float","double","void",
  6.                  "pointer","array","struct","union","enum","function"};
  7. char *storage_class_name[]={"strange","auto","register","static","extern","typedef"};
  8.  
  9. char *ename[]={"strange","sequence","move","set+","set-","set*","set/","set%",
  10.                "set&","set^","set|","set<<","set>>","?:","lor","land","or",
  11.                "eor","and","equal","unequal","lt","le","gt","ge","lsl",
  12.                "lsr","add","sub","mul","div","mod","negate",
  13.                "not","preinc","postinc","predec","postdec","neg",
  14.                "dref-pointer","address-of","cast","call","index",
  15.                "dref-struct-pointer","dref-struct","identifier","constant",
  16.                "string","member",
  17.                 "convert-char","convert-short","convert-int","convert-long",
  18.                 "convert-float","convert-double","convert-void","convert-pointer",
  19.                 "convert-uchar","convert-ushort","convert-uint","convert-ulong",
  20.                 "address-of-array","first-element-of-array","pmult",
  21.                 "allocreg","freereg","pconstant","test","label","beq","bne",
  22.                 "blt","bge","ble","bgt","bra","compare","push","pop",
  23.                 "address-of-struct","add-int-to-pointer","sub-int-from-pointer",
  24.                 "sub-pointer-from-pointer","push-reg","pop-reg","pop-args",
  25.                 "save-regs","restore-regs","identifier-label","dc","align",
  26.                 "colon","get-return","set-return","move-from-reg","move-to-reg",
  27.                 "nop"};
  28.  
  29. char *s,*ident;
  30. char string[MAXINPUT+2],number[MAXI],buff[MAXI];
  31. struct struct_declaration *first_sd[MAXN],*last_sd[MAXN],*merk_sdf,*merk_sdl;
  32. struct struct_identifier *first_si[MAXN],*last_si[MAXN],*merk_sif,*merk_sil;
  33. struct identifier_list *first_ilist[MAXN],*last_ilist[MAXN],*merk_ilistf,*merk_ilistl;
  34. struct llist *first_llist,*last_llist;
  35. int nesting;
  36. char *empty="";
  37. struct Var *first_var[MAXN],*last_var[MAXN],*merk_varf,*merk_varl;
  38.  
  39. zchar vchar; zuchar vuchar;
  40. zshort vshort; zushort vushort;
  41. zint vint; zuint vuint;
  42. zlong vlong; zulong vulong;
  43. zfloat vfloat; zdouble vdouble;
  44. zpointer vpointer;
  45.  
  46. #ifndef DEBUG
  47. int DEBUG;
  48. #endif
  49.  
  50. int label;
  51.  
  52. FILE *out,*ic1,*ic2,*ppout;
  53.  
  54. int nocode;
  55. int registerpri=200,currentpri,looppri=10;
  56. int return_label,return_value,break_label,switch_typ,switch_count,switch_act;
  57. struct Typ *return_typ;
  58. struct Var *return_var;
  59. zlong local_offset[MAXN];
  60.  
  61. int c_flags[MAXCF]={
  62.     VALFLAG,STRINGFLAG,0,0,
  63.     VALFLAG,0,0,0,
  64.     VALFLAG,FUNCFLAG,FUNCFLAG,VALFLAG,
  65.     VALFLAG,0,0,0,
  66.     0,0,0,0,
  67.     0,0,0,0,0,
  68.     VALFLAG
  69. };
  70. char *c_flags_name[MAXCF]={
  71.     "O","o","ic1","ic2",
  72.     "debug","noasm","quiet","ansi",
  73.     "maxerrors","dontwarn","warn","maxoptpasses",
  74.     "inline-size","nested-comments","cpp-comments","macro-redefinition",
  75.     "no-trigraphs","no-preprocessor","E","dontkeep-initialized-data",
  76.     "strip-path","fp-associative","iso","no-alias-opt","no-multiple-ccs",
  77.     "unroll-size"
  78. };
  79. union ppi c_flags_val[MAXCF];
  80.  
  81. int regs[MAXR+1],regused[MAXR+1];
  82. struct Var *regsv[MAXR+1],*regsbuf[MAXR+1];
  83. int regbnesting[MAXR+1];
  84.  
  85. char *inname;
  86.  
  87. zlong max_offset;
  88. int function_calls;
  89.  
  90. struct const_list *first_clist,*last_clist;
  91.  
  92. int afterlabel;
  93.  
  94. int goto_used;
  95.  
  96. struct err_out err_out[]={
  97. #include "errors.h"
  98. "",0
  99. };
  100. int err_num=sizeof(err_out)/sizeof(struct err_out)-1;
  101.  
  102. char *cur_func="shouldn't happen!";
  103. int ic_count;
  104. int lastlabel,fline;
  105. int read_new_line;
  106. int only_inline;
  107. struct IC *err_ic;
  108.  
  109. int multiple_ccs;
  110.  
  111. char *copyright="vbcc V0.5 (c) in 1995-97 by Volker Barthelmann\n";
  112.  
  113.